home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2004 September / GSSH0904CD1.iso / RiseofNations / RedFront / RedFront.exe / Red Front / Red Front - 11 - Bagration.bhs < prev    next >
Text File  |  2004-02-12  |  12KB  |  385 lines

  1. /* Red Front
  2.    Bagragion
  3.    
  4.    These events will control the Bagragion scenario for the Red Front campaign.
  5.   
  6.    Campaign By: Kevin 'DarthVeda' Chulski
  7.    Contact: darthveda@hotmail.com
  8.    Please email any questions/suggestions/comments that you have!   
  9. */
  10.  
  11. scenario
  12. {
  13.  
  14.   set_nation_name("Russians", $S("Red Army"));
  15.   set_nation_name("Romans", $S("Germans"));
  16.   
  17.   // initialize variables
  18.   
  19.   static int month = 6;
  20.   static int day = 23;
  21.   static int dayRate = 120;
  22.   static int rallyID = 0;
  23.   static int i = 0;
  24.   static int X = 0;
  25.   static int Y = 0;
  26.   
  27.   static int rReinReceive = 0;
  28.   static int gerKilled = 0;  
  29.   
  30.   
  31. labels {
  32.   //Add any constant labels here in a comma separated list.
  33.   
  34. }
  35.  
  36. run_once {
  37.   //Insert commands that should be executed only once when the script is loaded here.
  38.   
  39.   //disable weird things
  40.   
  41.   disable_type("Helicopter");
  42.   disable_type("Nuclear Missile");
  43.   disable_type("Missile Silo");
  44.   disable_type("Aircraft Carrier");
  45.   disable_type("Spy");
  46.   
  47.   // disable wonders
  48.   
  49.   disable_type( "Pyramids" );
  50.   disable_type( "Colossus" );
  51.   disable_type( "Terra Cotta Army" );
  52.   disable_type( "Colosseum" );
  53.   disable_type( "Temple of Tikal" );
  54.   disable_type( "Porcelain Tower" );
  55.   disable_type( "Angkor Wat" );
  56.   disable_type( "Versailles" );
  57.   disable_type( "Statue of Liberty" );
  58.   disable_type( "Kremlin" );
  59.   disable_type( "Taj Mahal" );
  60.   disable_type( "Eiffel Tower" );
  61.   disable_type( "Supercollider" );
  62.   disable_type( "Space Program" );
  63.   
  64.   // disable certain buildings and guys
  65.   
  66.   disable_type( "Small City" );
  67.   disable_type( "Citizen" );
  68.   disable_type( "Temple" );
  69.   disable_type( "Library" );
  70.   disable_type( "University" );
  71.   disable_type( "Airbase" );
  72.   disable_type( "Caravan" );
  73.   disable_type( "Supply Wagon" );
  74.   disable_type( "Shipyard" );
  75.   disable_type( "General" );
  76.   
  77.   // disable ships
  78.   
  79.   // Gain Upgrades
  80.   
  81.   gain_tech( 3, "Fortification" );
  82.   gain_tech( 3, "Bombardment" );
  83.   gain_tech( 3, "Strategic Reserves" );
  84.   
  85.   for ( i = 1; i < 5; i++ )
  86.   {
  87.     gain_upgrade(i, "Tactics");//Gain research tactics
  88.     gain_upgrade(i, "Operations");//Gain research operations
  89.     gain_upgrade(i, "Strategy");//Gain research strategy
  90.   }
  91.   
  92.   // disable upgrades 
  93.   
  94.   // set timers
  95.   
  96.   set_timer( "cdar", dayRate );
  97.   set_timer( "sovReinforcement", 240 );
  98.     
  99.   // disable triggers
  100.   
  101.   disable_trigger( "goSov" );
  102.   
  103.   // blurb or cinematic
  104.   
  105.   // miscelaneous  
  106.   
  107.   
  108.   for( i = 2; i < 5; i++ )
  109.   {
  110.     disable_production_ai( i );
  111.   }
  112.   if ( building_resource_bonus_disable() != 1 )
  113.   {
  114.     print_game_msg( "Error: couldn't disable building resources!" );
  115.   }
  116.   if ( buildings_gather_disable() != 1 )
  117.   {
  118.     print_game_msg( "Error: couldn't disable building gather!" );
  119.   }
  120.   if ( plunder_disable() != 1 )
  121.   {
  122.     print_game_msg( "Error: couldn't disable plunder!" );
  123.   }
  124.        
  125. }
  126.  
  127. //Main script body.
  128. //Add triggers and other commands to be executed each game frame here.
  129. //Use Edit->Insert Trigger Function to select from the list of available functions
  130. //Use Edit->Insert Trigger Block to add a blank trigger block.
  131. //See ./scenario/sample_script.bhs for additional documentation
  132.  
  133.   trigger opening_dialog ( )
  134.   {
  135.     add_objective_text( "Date: June 23, 1944", "date", "null.wav" );
  136.     popup_dialog( "June 1944 - Exactly three years after the German invasion of the Soviet Union, the armies of the Motherland stand poised to throw them out once and for all.  Stavka's plans for Operation \"Bagration\" calls for the elimination of German Army Group Center." );
  137.     popup_dialog( "Comrade General, your work to this point has been excellent, but much will be required of you for this offensive against the fascist invaders." );
  138.     popup_dialog( "Your first objective will be to establish a bridgehead across the Dnieper.  You must accomplish this objective by the 27th of June.  Also, keep an eye out for reinforcements, as they will arrive every other day." );
  139.     popup_dialog( "NEW OBJECTIVE: Establish a bridgehead by the 27th" );
  140.     add_objective( "Establish a bridgehead by the 27th", "river", "null.wav" );
  141.     add_reveal_point( 1, 195, 92, 10);
  142.     add_reveal_point( 1, 274, 147, 10);
  143.     add_reveal_point( 1, 321, 184, 10);
  144.   }
  145.   
  146.   trigger complete_river( city_assimilate( 1, "Orsha" ) || city_assimilate( 1, "Shklov" ) || city_assimilate( 1, "Mogilev" ) )
  147.   {
  148.     clear_reveal_points( 1 );
  149.     objective_complete( "river" );
  150.     popup_dialog( "Good work commander, we have established a bridgehead.  Your next objective is simple: sweep all the German defenders from the map by July 4." );
  151.     popup_dialog( "NEW OBJECTIVE: Route the German armies from the map" );
  152.     add_objective( "Route the German armies from the map", "route", "null.wav" );
  153.   }
  154.   
  155.   trigger river_failure ( is_trigger_enabled( "complete_river" ) && ( day == 28 ) )
  156.   {
  157.     popup_dialog( "The failure on your sector to capture a bridgehead over the Dnieper has scaled back the attack significantly.  Germany has had time to pour reinforcements into the area and it is unlikely that Bagration will lead anywhere conclusive.  You have been dismissed." );
  158.     defeat( 1 );
  159.   }
  160.  
  161.   trigger they_is_dead( num_cities( 3 ) < 2 )
  162.   {
  163.     objective_complete( "route" );
  164.     popup_dialog( "The German armies in the Summer of 1944 receive the most massive defeat of the war.  Operation 'Bagration' succeeds wildly, completely destroying 17 German divisions and smashing another 50." );
  165.     popup_dialog( "Comrade General, your excellent work has brought the Soviet Union to the very doorstep of the 3rd Reich: Warsaw.  From there, it will be a simple matter to drive onto Berlin!" );
  166.     popup_dialog( "You are now ready for the the twelfth and last part of this campaign.  Please load the next scenario in the Red Front sequence." );
  167.     victory( 1 );
  168.   }
  169.    
  170.   trigger calendar ( timer_expired( "cdar" ) )
  171.   {  
  172.     if ( day == 4 && month == 7 )
  173.     {
  174.       // It's the end of the scenario
  175.       popup_dialog( "General, the slowness of your sector to accomplish the mission objectives has scaled back the offensive significantly.  Germany has had time to pour reinforcements into the area and it is unlikely that Bagration will lead anywhere conclusive.  You have been dismissed." );
  176.       defeat( 1 );
  177.     }
  178.     else if ( day == 30 && month == 6 )
  179.     {
  180.       month = 7;
  181.       day = 1;
  182.     }
  183.     else
  184.     {
  185.       // normal increment
  186.       day++;
  187.     }
  188.  
  189.     if ( month == 6 )
  190.     {
  191.       change_objective_text( "date", "June " + day + ", 1944" );
  192.     }
  193.     else
  194.     {
  195.       change_objective_text( "date", "July " + day + ", 1944" );
  196.     }
  197.  
  198.     set_timer( "cdar", dayRate );    
  199.     enable_trigger( "calendar" );
  200.   }
  201.   
  202.   trigger add_soviet_reinforcements ( timer_expired( "sovReinforcement" ) )
  203.   {
  204.     enable_trigger( "goSov" );
  205.     rReinReceive = 0;
  206.     set_timer( "gogoSov", 1 );
  207.     
  208.     if ( population( 1 ) < population_cap( 1 ) )
  209.     {
  210.       print_game_msg( "Reinforcements are arriving." );
  211.       play_sound( "reinforce.wav" );
  212.     }
  213.       
  214.     set_timer( "sovReinforcement", 240 );
  215.     enable_trigger( "add_soviet_reinforcements" );
  216.   }
  217.   
  218.   trigger goSov ( timer_expired( "gogoSov" ) )
  219.   {
  220.     if ( population( 1 ) < population_cap( 1 ) ) // This makes sure no more guys can spawn if we already have a large army
  221.     {       
  222.       create_unit( 1, 315, 6, "Riflemen", 2 );
  223.       group_attack_to_order( 1, 283, 40 );
  224.       create_unit( 1, 383, 6, "Riflemen", 2 );
  225.       group_attack_to_order( 1, 359, 39 );
  226.       create_unit( 1, 395, 122, "Riflemen", 2 );
  227.       group_attack_to_order( 1, 356, 137 );
  228.     
  229.       if ( rReinReceive%3 == 0 )
  230.       {
  231.         create_unit( 1, 315, 6, "Tank", 1 );
  232.         group_attack_to_order( 1, 283, 40 );
  233.         create_unit( 1, 383, 6, "Tank", 1 );
  234.         group_attack_to_order( 1, 359, 39 );
  235.         create_unit( 1, 395, 122, "Tank", 1 );
  236.         group_attack_to_order( 1, 356, 137 );
  237.       }
  238.       if ( rReinReceive%4 == 0 )
  239.       {
  240.         create_unit( 1, 315, 6, "Katyusha Rocket", 1 );
  241.         group_attack_to_order( 1, 283, 40 );
  242.         create_unit( 1, 383, 6, "Katyusha Rocket", 1 );
  243.         group_attack_to_order( 1, 359, 39 );
  244.         create_unit( 1, 395, 122, "Katyusha Rocket", 1 );
  245.         group_attack_to_order( 1, 356, 137 );
  246.       }
  247.       if ( rReinReceive%5 == 0 )
  248.       {
  249.         create_unit( 1, 315, 6, "JS-2 Tank", 1 );
  250.         group_attack_to_order( 1, 283, 40 );
  251.         create_unit( 1, 383, 6, "JS-2 Tank", 1 );
  252.         group_attack_to_order( 1, 359, 39 );
  253.         create_unit( 1, 395, 122, "JS-2 Tank", 1 );
  254.         group_attack_to_order( 1, 356, 137 );
  255.         create_unit( 1, 315, 6, "Supply Wagon", 1 );
  256.         group_attack_to_order( 1, 283, 40 );
  257.         create_unit( 1, 383, 6, "Supply Wagon", 1 );
  258.         group_attack_to_order( 1, 359, 39 );
  259.         create_unit( 1, 395, 122, "Supply Wagon", 1 );
  260.         group_attack_to_order( 1, 356, 137 );
  261.       }
  262.       if ( rReinReceive == 0 )
  263.       {
  264.         create_unit( 1, 315, 6, "General", 1 );
  265.         group_attack_to_order( 1, 283, 40 );
  266.         create_unit( 1, 383, 6, "General", 1 );
  267.         group_attack_to_order( 1, 359, 39 );
  268.         create_unit( 1, 395, 122, "General", 1 );
  269.         group_attack_to_order( 1, 356, 137 );
  270.       }
  271.     }
  272.     
  273.     rReinReceive++;
  274.     
  275.     if ( rReinReceive < 9 )
  276.     {
  277.       set_timer( "gogoSov", 1 );
  278.       enable_trigger( "goSov" );
  279.     }
  280.     
  281.   }
  282.   
  283.   trigger gerInforce ( num_units_lost( 3 ) > gerKilled )
  284.   {
  285.     int killDiff = absl_int( num_units_lost( 3 ) - gerKilled );
  286.     gerKilled = num_units_lost( 3 );
  287.     rand_seed( score( 1 ) );
  288.     
  289.     while ( killDiff != 0 )
  290.     {
  291.       i = rand_int( 1, 101 );
  292.       if ( ( i%3 == 0 ) && ( is_military_building( 3, 2037 ) == 1 ) )
  293.       {
  294.         X = 71;
  295.         Y = 59;
  296.       }
  297.       else if ( ( i%3 == 1 ) && ( is_military_building( 3, 2020 ) == 1 ) )
  298.       {
  299.         X = 335;
  300.         Y = 252;
  301.       }
  302.       else if ( ( i%3 == 2 ) && ( is_military_building( 3, 2031 ) == 1 ) )
  303.       {
  304.         X = 133;
  305.         Y = 331;
  306.       }
  307.       else
  308.       {
  309.         enable_trigger( "gerInforce" );
  310.         break;
  311.       } 
  312.       
  313.       if ( i > 95 )
  314.       {
  315.         // Spawn Howitzer
  316.         create_unit( 3, X, Y, "Howitzer", 1 );
  317.       }
  318.       else if ( i > 85 )
  319.       {
  320.         // Spawn Armored Scout Car
  321.         create_unit( 3, X, Y, "Armored Scout Car", 1 );
  322.       }
  323.       else if ( i > 70 )
  324.       {
  325.         // Spawn MG42
  326.         create_unit( 3, X, Y, "MG42", 1 );
  327.       }
  328.       else if ( i > 50 )
  329.       {
  330.         // Spawn Tiger
  331.         create_unit( 3, X, Y, "Tiger Tank", 1 );
  332.       }
  333.       else
  334.       {
  335.         // Spawn Infantry
  336.         create_unit( 3, X, Y, "Volksgrenadiers", 1 );
  337.       }
  338.       killDiff--;      
  339.     }
  340.     
  341.     enable_trigger( "gerInforce" );      
  342.   }
  343.   
  344.   trigger theBigHammer ( time_sec( ) == 30 )
  345.   {
  346.     set_timer( "theBigAttack", 5 );
  347.   }
  348.   
  349.   trigger sovAttackers( timer_expired( "theBigAttack" ) )
  350.   {
  351.     create_unit( 2, 391, 341, "Riflemen", 20 );
  352.     group_attack_to_order( 2, 92, 379 );
  353.     create_unit( 2, 391, 341, "Tank", 4 );
  354.     group_attack_to_order( 2, 92, 379 );
  355.     create_unit( 2, 391, 341, "Katyusha Rocket", 3 );
  356.     group_attack_to_order( 2, 92, 379 );
  357.     
  358.     create_unit( 4, 14, 3, "Red Guards Infantry", 15 );
  359.     group_attack_to_order( 4, 92, 379 );
  360.     create_unit( 4, 14, 3, "JS-2 Tank", 3 );
  361.     group_attack_to_order( 4, 92, 379 );
  362.     create_unit( 4, 14, 3, "Katyusha Rocket", 3 );
  363.     group_attack_to_order( 4, 92, 379 );
  364.     
  365.     set_timer( "theBigAttack", 240 );
  366.     enable_trigger( "sovAttackers" );
  367.   }
  368.   
  369.   trigger noMoney ( )
  370.   {
  371.   
  372.     for( i = 1; i < 5; i++ )
  373.     {
  374.       set_good( i, "food", 0 );
  375.       set_good( i, "timber", 0 );
  376.       set_good( i, "metal", 0 );
  377.       set_good( i, "oil", 0 );
  378.       set_good( i, "wealth", 0 );
  379.       set_good( i, "knowledge", 0 );
  380.     }
  381.    
  382.     enable_trigger( "noMoney" ); 
  383.   }
  384.     
  385. }